package org.idea.qiyu.framework.canal.split.table.service;


import org.idea.qiyu.framework.canal.split.table.mapper.UserMapper;
import org.idea.qiyu.framework.canal.split.table.po.UserPO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Author linhao
 * @Date created in 8:21 下午 2021/6/21
 */
@Service
public class UserService {

    @Resource
    private UserMapper userMapper;

    public void insertUser(UserPO userPO) {
        if(userPO.getUser_id()==null){
            return;
        }
        int index = (int) (userPO.getUser_id() % 10);
        String indexStr;
        indexStr = "0" + index;
        userMapper.insertOne(indexStr, userPO.getUser_id(), userPO.getUsername());
    }

    public static void main(String[] args) {
        System.out.println(0 % 10);
        System.out.println(1 % 10);
        System.out.println(2 % 10);
        System.out.println(3 % 10);
        System.out.println(4 % 10);
        System.out.println(5 % 10);
        System.out.println(6 % 10);
        System.out.println(7 % 10);
        System.out.println(8 % 10);
        System.out.println(9 % 10);
        System.out.println(10 % 10);
        System.out.println(1740833502 % 10);
    }
}
